<template>
    <el-container>

        <div class="bg-container">
            <el-carousel indicator-position="none" height="100vh" :interval="5000">
                <el-carousel-item v-for="item in bg_url" :key="item">
                    <el-image :src="item" fit="cover"></el-image>
                </el-carousel-item>
            </el-carousel>
            <div class="container">
                <transition name="component-fade" mode="out-in">
                    <router-view />
                </transition>
            </div>
            <el-image :src="require('@/assets/logo.svg')" fit="cover" class="logo"></el-image>
        </div>
    </el-container>
</template>

<script>
export default {
    data() {
        return {
            bg_url: [
                "https://youimg1.c-ctrip.com/target/100i12000000rth5vAE6E.jpg",
                "https://img1.qunarzz.com/travel/d9/1706/69/26ff8348ee53ceb5.jpg",
                "https://youimg1.c-ctrip.com/target/100l0k000000bewlmDD4D.jpg",

            ]
        }
    }

}
</script>

<style lang="less" scoped>
.container {
    position: absolute;
    top: 50%;
    left: 25%;
    transform: translate(0, -50%);
}

.el-container {
    width: 100%;
    height: 100%;

    .bg-container {
        width: 100%;
        height: 100%;

        .el-carousel {
            z-index: -1;
            height: 100%;

            .el-image {
                width: 100vw;
                height: 100vh;
            }
        }

        .logo {
            position: absolute;
            top: 50%;
            right: 13%;
            width: 500px;
            transform: translate(0, -50%);
        }

        @media (max-width: 1526px) {
            .logo {
                position: absolute;
                top: 15%;
                left: 50%;
                width: 300px;
                transform: translate(-50%, -50%);
            }
        }
    }
}

@media (max-width: 1526px) {

    .container {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
    }


}


// 卡片切换动画
.component-fade-enter,
.component-fade-leave-to {
    opacity: 0;
    transform: scale(0.3) translate(100px, -100px) rotate(15deg);
}

.component-fade-enter-active,
.component-fade-leave-active {
    transition: all 0.5s ease;
}
</style>